﻿@using NigiriClub.WebUI.Models
@model NigiriClub.WebUI.Models.PagedCollections.GamesModel

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<script>
    $(document)
        .on('change', '.btn-file :file', function () {
            var input = $(this),
            numFiles = 1,
            label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
            input.trigger('fileselect', [numFiles, label]);
        });


    $(document).ready(function () {
        $('.btn-file :file').on('fileselect', function (event, numFiles, label) {

            var input = $(this).parents('.input-group').find(':text'),
                log = numFiles > 1 ? numFiles + ' files selected' : label;

            if (input.length) {
                input.val(log);
            } else {
                if (log) alert(log);
            }

        });
    });
</script>

@{Account loggedIn = Account.GetAccount(User.Identity.Name);}

<ul class="nav nav-tabs" style="margin-bottom: 15px;">
    <li class="active"><a href="#home" data-toggle="tab">Партии</a></li>
    <li class=""><a href="#profile" data-toggle="tab">Партии на разбор</a></li>
</ul>
<div id="myTabContent" class="tab-content">
    <div class="tab-pane fade active in" id="home">
        @Html.Action("Games", "Games", new { isReviewed = true })
        @if (loggedIn != null)
        {
            @Html.Partial("UploadReviewedSgf", new NigiriClub.WebUI.Models.FileModel())
        }
    </div>
    <div class="tab-pane fade" id="profile">
        @Html.Action("Games", "Games", new { isReviewed = false })
        @if (loggedIn != null)
        {
            @Html.Partial("UploadSgf", new NigiriClub.WebUI.Models.Game() { IsReviewed = false })
        }
    </div>
</div>


